package cn.tedu.boyou.acticle.domain;

import cn.tedu.boyou.common.domain.BaseDomain;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter@Setter
public class Festival extends BaseDomain{

    private String name; //节日名称

    private Integer state;  //节日发布状态

    private Integer sequence;   //节日显示排序的优先级

    public String getJsonString(){

        Map<String, Object> map = new HashMap<>();

        map.put("id",id);
        map.put("name",name);
        map.put("state",state);
        map.put("sequence",sequence);
        map.put("stateString",getStateString());

        return JSON.toJSONString(map);
    }

    public String getStateString(){
        if (state == 0){
            return "禁止状态";
        }
        return "启用状态";
    }
}